import request from "@/utils/request";

export default {

    // 获取所有角色
    getRoles() {
        return request({
            url: 'http://localhost/api/system/role/getRoles',
            method: 'get',
        });
    },

    //获取所有角色带分页带条件
    getPageRoles(currentPage,limit,name) {
        return request({
            url: `http://localhost/api/system/role/getRolePageByName?currentPage=${currentPage}&limit=${limit}&name=${name}`,
            method: 'get',
        });
    },


    //添加角色信息
    addRole(data,menuIds) {
        return request({
            url: `http://localhost/api/system/role/addRole?menuIds=${menuIds}`,
            method: 'post',
            data
        });
    },

    //修改角色信息
    updateRole(data,menuIds) {
        return request({
            url: `http://localhost/api/system/role/updateRole?menuIds=${menuIds}`,
            method: 'post',
            data
        });
    },


    //修改角色信息
    deleteRoleById(id) {
        return request({
            url: `http://localhost/api/system/role/deleteRole?id=${id}`,
            method: 'post'
        });
    },
}